/**
 * 
 */
package any.radeox;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.StringUtils;

/**
 * @author keke
 * @version $Revision: 21 $
 */
public class Outline {
	static class Entry {
		List<Entry>	children	= new ArrayList<Entry>();
		Integer[]	headers;
		int		    level		= 0;
		String		name;
		Entry		parent;

		public Entry add(final Entry entry) {
			entry.parent = this;
			children.add(entry);
			return this;
		}

		public String getHeaderName() {
			return StringUtils.join(headers, ".");
		}
	}

	private Entry	current;
	private Entry	root	= new Entry();

	public Entry getCurrent() {
		return current;
	}

	public Entry getRoot() {
		return root;
	}

	public void setCurrent(final Entry current) {
		this.current = current;
	}

	public void setRoot(final Entry root) {
		this.root = root;
	}
}
